<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>VDS Manager</title>
  </head>
  <body>
  	<div align="center" style="font-family: 黑体;">
  		<table style="text-align: center;">
  			<thead>
  				<h2>设备状态信息</h2>
  			</thead>
  			<tbody>
	  			<tr>
	  				<th width="16px">ID</th>
	  				<th width="128px">型号</th>
	  				<th width="128px">当前用户</th>
	  				<th width="96px">状态</th>
	  			</tr>
	  			<s:iterator id="devStatus" value="#request.vdsDeviceStatus">
	  				<tr>
	  					<td><s:property value="#devStatus.getDeviceInformation().getId()" /></td>
	  					<td><s:property value="#devStatus.getDeviceInformation().getModel()" /></td>
	  					<td><s:property value="#devStatus.getUser().getUser()" /></td>
	  					<s:set name="time_now" value="(new java.util.Date()).getTime()" />
	  					<s:set name="expired_time" value="#devStatus.getExpiredTime().getTime()" />
	  					<s:if test="#expired_time >= #time_now">
	  						<td><s:text name="listVDSDeviceStatusAction.online" /></td>
	  					</s:if>
	  					<s:else>
	  						<td><s:text name="listVDSDeviceStatusAction.offline" /></td>
	  					</s:else>
	  				</tr>
  				</s:iterator>
  				<tr>
  					<td>&nbsp;</td>
  					<td>&nbsp;</td>
  					<td>&nbsp;</td>
  					<td><a href="<%=path %>/management/vds/listVDSDeviceStatus.action">刷新</a></td>
  				</tr>
  			</tbody>
  		</table>
  	</div>
  	
  </body>
</html>
